package compiler;


public class TypeManager {


	public static Type parseType( String type ){
		if ( type.equals( "Integer" ) ) return Type.Integer_t;
		if ( type.equals( "char" ) ) return Type.char_t;
		if ( type.equals( "array_of_char" ) ) return Type.array_of_char_t;
		if ( type.equals( "array_of_integer" ) ) return Type.array_of_integer_t;
		return Type.ERROR_TYPE_t;		
	}
	
	//Velikost v bytech
	public static int getTypeSize( Type type ){
		if ( type == Type.Integer_t ) return 4;
		if ( type == Type.char_t ) return 1;
		if ( type == Type.array_of_char_t ) return 4;
		if ( type == Type.array_of_integer_t ) return 4;
		return 0;
		
	}
	

	
	
}
